package com.example.classconnect;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class ClassAdapter extends ArrayAdapter<String> {
	
	Context mContext;
	int mLayoutResourceId;
	
	public ClassAdapter(Context context, int layoutResourceId) {
		super(context, layoutResourceId);

		mContext = context;
		mLayoutResourceId = layoutResourceId;
	}
	public View getView(int position, View convertView, ViewGroup parent) {
		View row = convertView;

		final String currentClass = getItem(position);

		if (row == null) {
			LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
			row = inflater.inflate(mLayoutResourceId, parent, false);
		}
		row.setTag(currentClass);
		return row;
	}
}
